#pragma once

#include "gametemplate.h"

class CAnimationTemplate: public ITemplate
{
public:
	BYTE kind;
	float att_front_dist;
	float att_back_dist;
	float att_plus;
	USHORT impact_time;
	float mov_dist;
	BYTE damage_ani_type;
	float knockback_dist;
	USHORT knockdown_time;
	BYTE unusual_condition;
	USHORT unusual_condition_time;
	string plist;
	string png;
	BYTE png_count;
};

class CAnimationXMLParser :public CCSAXDelegator
{
public:
	bool initParsing();

private:
	void parseXMLFile();
	void startElement(void *ctx, const char *name, const char **atts);
	void endElement(void *ctx, const char *name);
	void textHandler(void *ctx, const char *s, int len);

	const char *_animFile;
	GAMETEMPLATE::TYPE _type;

typedef CAnimationTemplate TEMPLATE_TYPE;

private:
	string _lastelement;
	TEMPLATE_TYPE* _lastTemplate;
};